<form id="add-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="">
    {:token()}

    <div class="form-group">
        <label for="title" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" id="title" name="row[name]" value="" data-rule="required;title" />
        </div>
    </div>
    <div class="form-group">
        <label for="price" class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="number" class="form-control" id="price" name="row[price]" value=""
                data-rule="required;price" />
        </div>
    </div>
    <div class="form-group">
        <label for="c-avatar" class="control-label col-xs-12 col-sm-2">{:__('Thumbs')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-avatar" data-rule="" class="form-control" size="50" name="row[thumbs]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-avatar" class="btn btn-danger faupload"
                            data-multiple="true" data-input-id="c-avatar"
                            data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false"
                            data-preview-id="p-avatar"><i class="fa fa-upload"></i>
                            上传</button></span>
                    <span><button type="button" id="fachoose-avatar" class="btn btn-primary fachoose"
                            data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false"><i
                                class="fa fa-list"></i> 选择</button></span>
                </div>
                <span class="msg-box n-right" for="c-avatar"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-avatar"></ul>
        </div>
    </div>
    <!-- 商品分类 -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('TypeName')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[typeid]', $type, null, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
        </div>
    </div>
    <!-- 商品单位 -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('UnitName')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[unitid]', $unit, null, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
        </div>
    </div>
    <!-- 商品押金 -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Rent')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="number" class="form-control" id="price" name="row[rent]" value="" data-rule="required;price" />
        </div>
    </div>
    <!-- 日租 -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('RentPrice')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="number" class="form-control" id="price" name="row[rent_price]" value=""
                data-rule="required;price" />
        </div>
    </div>
    <!-- 商品租赁状态 -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Rentstatus')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[rentstatus]', $rentstatus, null, ['class'=>'form-control selectpicker',
            'data-rule'=>'required'])}
        </div>
    </div>
    <!-- 商标签 -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[flag]', $flag, null, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
        </div>
    </div>
    <div class="form-group">
        <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="content" name="row[content]" value="" data-rule="required;content" class="editor" cols="30"
                rows="10"></textarea>
        </div>
    </div>

    <div class="form-group hidden layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>